package com.gxuwz.zhangjiahui.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gxuwz.zhangjiahui.entity.Student;
import com.gxuwz.zhangjiahui.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangjiahui
 * @since 2021-06-20
 */
@Mapper
@Repository
public interface StudentMapper extends BaseMapper<Student> {

    // 根据 id 查询对应信息
    Student findStudentById(Student student);

    // 查询全部信息
    List<Student> findStudentAll();

    //自定义sql 分页
    IPage<Student> selectStudentPage(Page<Student> page, @Param(Constants.WRAPPER) Wrapper<Student> wrapper);

    // 添加信息
    void addStudent(Student student);

    // 修改信息
    void updateStudentById(Student student);

    // 删除信息
    void deleteStudentById(Student student);

}
